package es.udc.emarketapp.emarket.model.usersFacade.actions;

import es.udc.emarketapp.emarket.model.client.dao.SQLClientDAO;
import es.udc.emarketapp.emarket.model.client.dao.SQLClientDAOFactory;
import es.udc.emarketapp.emarket.model.client.vo.ClientVO;
import es.udc.emarketapp.emarket.util.exceptions.model.NifCifAlreadyExistsException;
import es.udc.emarketapp.emarket.util.exceptions.model.UserNameAlreadyExistsException;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import java.sql.Connection;

import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import es.udc.fbellas.j2ee.util.exceptions.ModelException;
import es.udc.fbellas.j2ee.util.sql.TransactionalPlainAction;

public class ModifyClientAction implements TransactionalPlainAction {

    private ClientVO clientVO;

    public ModifyClientAction(ClientVO clientVO) {
        this.clientVO = clientVO;
    }

    public Object execute(Connection connection)
            throws InternalErrorException, InstanceNotFoundException {

        SQLClientDAO clientDAO = SQLClientDAOFactory.getDAO();

        clientDAO.updateClient(connection, clientVO);

        return null;
        
        }
}
